package com.kaikeba.bean;


import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

public class User {
    private int id;
    private String number;
    private String username;
    private String userPhone;
    private String password;
    private Timestamp loginTime;
    private Timestamp inTime;
    private int status;
    private boolean isUser;
    private int expressLong;

    public int getExpressLong() {
        return expressLong;
    }

    public void setExpressLong(int expressLong) {
        this.expressLong = expressLong;
    }

    public boolean isUser() {
        return isUser;
    }

    public void setUser(boolean user) {
        isUser = user;
    }

    private List<Express> expressList;

    public User(int id, String number, String username, String userPhone, String password, Timestamp loginTime, Timestamp inTime, int status) {
        this.id = id;
        this.number = number;
        this.username = username;
        this.userPhone = userPhone;
        this.password = password;
        this.loginTime = loginTime;
        this.inTime = inTime;
        this.status = status;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", number='" + number + '\'' +
                ", username='" + username + '\'' +
                ", userPhone='" + userPhone + '\'' +
                ", password='" + password + '\'' +
                ", loginTime=" + loginTime +
                ", inTime=" + inTime +
                ", status=" + status +
                ", isUser=" + isUser +
                ", expressLong=" + expressLong +
                ", expressList=" + expressList +
                '}';
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        User user = (User) o;
        return id == user.id &&
                status == user.status &&
                isUser == user.isUser &&
                expressLong == user.expressLong &&
                Objects.equals(number, user.number) &&
                Objects.equals(username, user.username) &&
                Objects.equals(userPhone, user.userPhone) &&
                Objects.equals(password, user.password) &&
                Objects.equals(loginTime, user.loginTime) &&
                Objects.equals(inTime, user.inTime) &&
                Objects.equals(expressList, user.expressList);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, number, username, userPhone, password, loginTime, inTime, status, isUser, expressLong, expressList);
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Timestamp getLoginTime() {
        return loginTime;
    }

    public void setLoginTime(Timestamp loginTime) {
        this.loginTime = loginTime;
    }

    public Timestamp getInTime() {
        return inTime;
    }

    public void setInTime(Timestamp inTime) {
        this.inTime = inTime;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public List<Express> getExpressList() {
        return expressList;
    }

    public void setExpressList(List<Express> expressList) {
        this.expressList = expressList;
    }

    public User(String number, String username, String userPhone, String userPassword) {
        this.number = number;
        this.username = username;
        this.userPhone = userPhone;
        this.password = userPassword;
    }

    public User() {

    }
}
